<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function getAge(){
        return new Date().getFullYear() - this.birthday;
    }
    let person = {
        name:'lx',
        birthday:2000,
        age: getAge
    }
    getAge.apply(person);
</script>
</body>
</html>